<?php include "../public/header.php";?>
<?php include "../public/header_public.php";?>
<link rel='stylesheet' href='/static/admin/css/ban.css'>
<script type="text/javascript" src="/static/admin/echarts/echarts.min.js"></script>
<style>
    .xm-label-block{border: unset!important;}
    .xm-label-block span{font-size: 16px!important;}
    .xm-icon-close{display: none!important;}
    .leftengin .tuo:hover,.danbox:hover{background: #f6f6f6 !important;}
    #role1{float: left}
    .busdiv{width: 200px;float: left;margin-left: 20px}
    .busdiv input{height: 30px!important;}
    #bancha{height: 28px;line-height: 28px;margin-top: 2px!important;padding-top: 0!important;}
    #bancha{height: 28px;line-height: 28px;margin-left: 20px}
    .layui-select-title input{height: 30px}
    #banreset{height: 28px;line-height: 28px;margin-top: 2px!important;padding-top: 0!important;background-color: #FFFFFF!important;}
    #banreset{height: 28px;line-height: 28px;color: #2272eb!important;}

    .busdiv222{float: right;margin-right: 20px}
    #but_ban_zi{color: #2272eb!important;background-color: #FFFFFF!important;}
    #but_ban_cai{color: #2272eb!important;background-color: #FFFFFF!important;}
</style>
<body id="banLianPage">
<div id="banBox">
    <div class="minbox" style="margin-bottom: 10px;padding-top: 10px;height: 40px;">
        <div id="role1">
            <div id="chanid" class="xmselect_div" style="width: 300px;height: 40px;margin-left: 20px"></div>
        </div>
        <div id="enginidstr" class="layui-hide"></div>

        <div class="busdiv layui-form">
            <input type="text" name="enginname" placeholder="项目名称" class="layui-input" autocomplete="off">
        </div>
        <div class="busdiv layui-form">
            <input type="text" name="man_xiang" placeholder="项目负责人" class="layui-input" autocomplete="off">
        </div>
        <div class="busdiv layui-form" style="width: 80px;">
            <button class="laytp-btn laytp-btn-md laytp-btn-primary" id="bancha" type="button"><i class="layui-icon layui-icon-search"></i>查询</button>
        </div>
        <div class="busdiv layui-form" style="margin-left: 10px!important;">
            <button class="laytp-btn laytp-btn-md laytp-btn-primary"  id="banreset" type="button"><i class="layui-icon layui-icon-refresh"></i>重置</button>
        </div>


        <div class="busdiv222 layui-form">
            <button class="laytp-btn laytp-btn-md laytp-btn-primary" id="but_ban_cai" type="button">财务看板</button>
        </div>
        <div class="busdiv222 layui-form">
            <button class="laytp-btn laytp-btn-md laytp-btn-primary" id="but_ban_lian" type="button">联营项目看板</button>
        </div>
        <div class="busdiv222 layui-form">
            <button class="laytp-btn laytp-btn-md laytp-btn-primary" id="but_ban_zi" type="button">自营项目看板</button>
        </div>
    </div>
    <div class="conbox">
        <div class="topbox">
            <div class="he he1">
                <div class="w1">在建项目数量</div>
                <div class="w2" id="top_zai">0</div>
                <img src="/static/admin/images/ban/top_7.png">
            </div>
            <div class="he he2">
                <div class="w1">施工合同总额</div>
                <div class="w2" id="top_shimoney">0</div>
                <img src="/static/admin/images/ban/top_5.png">
            </div>
            <div class="he he3">
                <div class="w1">累计开票</div>
                <div class="w2" id="top_piaokai">0</div>
                <img src="/static/admin/images/ban/top_1.png">
            </div>
            <div class="he he4">
                <div class="w1">累计收票</div>
                <div class="w2" id="top_piaoshou">0</div>
                <img src="/static/admin/images/ban/top_2.png">
            </div>
            <div class="he he5">
                <div class="w1">资金余额</div>
                <div class="w2" id="top_yufee">0</div>
                <img src="/static/admin/images/ban/top_8.png">
            </div>
        </div>
        <div class="clear"></div>
        <div class="botbox">
            <div class="zuo">
                <div class="thd">发票分析</div>
                <div class="tbd" id="zixi">
                    <div class="gtou">
                        <div class="t1">开票合计</div>
                        <div class="t2" id="za_piaokaihe">0</div>
                        <div class="t3 layui-form">
                            <select id="piaokai_year" name="piaokai_year" lay-filter="piaokai_year"></select>
                        </div>
                    </div>
                    <div class="clear"></div>
                    <div class="chart" id="chart_piaokai" style="margin-top: 10px"></div>

                    <div class="gtou">
                        <div class="t1">收票合计</div>
                        <div class="t2" id="za_piaoshouhe">0</div>
                        <div class="t3 layui-form">
                            <select id="piaoshou_year" name="piaoshou_year" lay-filter="piaoshou_year"></select>
                        </div>
                    </div>
                    <div class="clear"></div>
                    <div class="chart" id="chart_piaoshou"></div>

                    <div class="gtou">
                        <div class="t1">增值税</div>
                    </div>
                    <div class="clear"></div>
                    <div class="chart" id="zengshui">
                        <div class="bb">
                            <div>
                                <span class="w1">销项税额</span>
                                <span class="w2" id="za_piao_xiao">0</span>
                            </div>
                            <img src="/static/admin/images/ban/bot_11.png">
                        </div>
                        <div class="bb">
                            <div>
                                <span class="w1">进项税额</span>
                                <span class="w2" id="za_piao_jin">0</span>
                            </div>
                            <img src="/static/admin/images/ban/bot_10.png">
                        </div>
                        <div class="bb bb2">
                            <div>
                                <span class="w1">增值税</span>
                                <span class="w2" id="za_piao_ying">0</span>
                            </div>
                            <img src="/static/admin/images/ban/bot_15.png">
                        </div>
                    </div>
                </div>
                <div class="thd">成本分析</div>
                <div class="tbd" id="xiangshou">
                    <div class="gtou">
                        <div class="t1">总成本</div>
                        <div class="t2" id="za_zongcheng">0</div>
                    </div>
                    <div class="clear"></div>
                    <div class="chart" id="chart_zongcheng"></div>
                </div>
            </div>
            <div class="zho">
                <div class="thd">收付款分析</div>
                <div class="tbd" id="zixi">
                    <div class="gtou">
                        <div class="t1">项目收款</div>
                        <div class="t2" id="za_huikuan">0</div>
                        <div class="t3 layui-form">
                            <select id="xiangshou_year" name="xiangshou_year" lay-filter="xiangshou_year"></select>
                        </div>
                    </div>
                    <div class="clear"></div>
                    <div class="chart" id="chart_xiangshou"></div>

                    <div class="gtou">
                        <div class="t1">支付供应商</div>
                        <div class="t2" id="za_payment_engin">0</div>
                        <div class="t3 layui-form">
                            <select id="zhigong_year" name="zhigong_year" lay-filter="zhigong_year"></select>
                        </div>
                    </div>
                    <div class="clear"></div>
                    <div class="chart" id="chart_zhigong"></div>

                    <div class="gtou">
                        <div class="t1">支付联营方</div>
                        <div class="t2" id="za_payment_neifu">0</div>
                        <div class="t3 layui-form">
                            <select id="zhilian_year" name="zhilian_year" lay-filter="zhilian_year"></select>
                        </div>
                    </div>
                    <div class="clear"></div>
                    <div class="chart" id="chart_zhilian"></div>

                </div>
                <div class="thd">保证金</div>
                <div class="tbd" id="baojin">
                    <div class="chart" id="chart_baojin"></div>
                </div>
            </div>
            <div class="you">
                <div class="thd">扣收费用</div>
                <div class="tbd" id="zixi">
                    <div class="gtou">
                        <div class="t1">扣收合计</div>
                        <div class="t2" id="za_payment_neikou">0</div>
                    </div>
                    <div class="clear"></div>
                    <div class="chart" id="chart_koushou"></div>
                </div>

                <div class="thd">垫资</div>
                <div class="tbd" id="dianzi">
                    <div class="bb">
                        <div class="w1" id="za_dian">0</div>
                        <div class="w2">累计垫资</div>
                        <img src="/static/admin/images/ban/bot_8.png">
                    </div>
                </div>

                <div class="thd">资金余额</div>
                <div class="tbd" id="ziyu">
                    <div class="bb">
                        <div class="w2">可用余额</div>
                        <div class="w1" id="za_balance">0</div>
                        <div class="w3">联营项目可用资金余额计算方式：</div>
                        <img src="/static/admin/images/ban/bot_7.png">
                        <div class="w4">项目收款(含垫资)-支付供应商-支付联营方(含退回垫资）-扣收费用</div>
                    </div>
                </div>

                <div class="thd">质量安全</div>
                <div class="tbd" id="zhian">
                    <div class="bb">
                        <div class="w1" id="zhian_xun">0</div>
                        <div class="w2">巡检次数</div>
                        <img src="/static/admin/images/ban/bot_12.png">
                    </div>
                    <div class="bb">
                        <div class="w1" id="zhian_zheng">0</div>
                        <div class="w2">整改通知下达</div>
                        <img src="/static/admin/images/ban/bot_16.png">
                    </div>
                    <div class="bb">
                        <div class="w1" id="zhian_yigai">0</div>
                        <div class="w2">已整改</div>
                        <img src="/static/admin/images/ban/bot_13.png">
                    </div>
                    <div class="bb">
                        <div class="w1" id="zhian_daigai">0</div>
                        <div class="w2">待整改</div>
                        <img src="/static/admin/images/ban/bot_4.png">
                    </div>
                    <div class="bb">
                        <div class="w1 colorhong" id="zhian_daigaiyu">0</div>
                        <div class="w2">逾期未整改</div>
                        <img src="/static/admin/images/ban/bot_14.png">
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
        <div style="height: 80px"></div>
    </div>

</div>
<script>
    layui.use(['form', 'layer', "laytp",'element','dropdown'], function() {
        var form = layui.form,element = layui.element;

        get_lian_zong_ban();
        $("#bancha").click(function (e) {
            get_lian_zong_ban();
        });
        $("#banreset").click(function () {
            window.location.reload();
        });

        form.on('select(piaokai_year)', function(data){
            get_lian_chart_piaokai_ban()
        });
        form.on('select(piaoshou_year)', function(data){
            get_lian_chart_piaoshou_ban()
        });
        form.on('select(xiangshou_year)', function(data){
            get_lian_chart_xiangshou_ban()
        });
        form.on('select(zhigong_year)', function(data){
            get_lian_chart_zhigong_ban()
        });
        form.on('select(zhilian_year)', function(data){
            get_lian_chart_zhilian_ban()
        });

        function get_lian_zong_ban(){
            setTimeout(function () {
                var chanid = $("input[name='chanid']").val() || 0;
                var enginname = $("input[name='enginname']").val() || '';
                var man_xiang = $("input[name='man_xiang']").val() || '';

                facade.ajax({url: ask_lian_zong_ban, data:{
                        chanid:chanid,
                        enginname:enginname,
                        man_xiang:man_xiang,
                    }}).done(function(res){
                    if (res.code === 2000) {
                        var data = res.data;
                        var toparr = data.top;

                        $("#top_zai").html(toparr.zai);
                        $("#top_shimoney").html(parseFormatNum(toparr.shimoney));
                        $("#top_piaokai").html(parseFormatNum(toparr.piaokai));
                        $("#top_piaoshou").html(parseFormatNum(toparr.piaoshou));
                        $("#top_yufee").html(parseFormatNum(toparr.yufee));

                        $("#enginidstr").text(data.enginidstr);
                        xmselect_dan('chanid', res.data.chanid, res.data.is_chanid)


                        var yearStr = '';
                        var yeararr = res.data.yeararr;
                        for (var key in yeararr){
                            if(res.data.yearjin == yeararr[key]){
                                yearStr += '<option value="'+yeararr[key]+'" selected>'+yeararr[key]+'年</option>';
                            }else{
                                yearStr += '<option value="'+yeararr[key]+'">'+yeararr[key]+'年</option>';
                            }
                        }
                        $("#piaokai_year").html(yearStr);
                        $("#piaoshou_year").html(yearStr);
                        $("#xiangshou_year").html(yearStr);
                        $("#zhigong_year").html(yearStr);
                        $("#zhilian_year").html(yearStr);
                        render_from();


                        get_lian_chart_koushou_ban();
                        get_lian_zhian_ban();
                        get_lian_chart_piaokai_ban()
                        get_lian_chart_piaoshou_ban()
                        get_lian_chart_zongcheng_ban()
                        get_lian_chart_xiangshou_ban()
                        get_lian_chart_zhigong_ban()
                        get_lian_chart_zhilian_ban()
                        get_lian_chart_baojin_ban()

                        get_lian_zaxiang_ban();
                    }
                });
            },300);
        }

        function get_lian_chart_koushou_ban() {
            var enginidstr = $("#enginidstr").text();
            facade.ajax({url: ask_lian_chart_koushou_ban, data:{enginidstr:enginidstr}}).done(function(res){
                if (res.code === 2000) {
                    var data = res.data;
                    chart_koushou('chart_koushou', res.data.info);
                }
            });
        }
        function get_lian_zhian_ban() {
            var enginidstr = $("#enginidstr").text();
            facade.ajax({url: ask_lian_zhian_ban, data:{enginidstr:enginidstr,}}).done(function(res){
                if (res.code === 2000) {
                    var data = res.data;
                    $("#zhian_xun").html(data.xun);
                    $("#zhian_zheng").html(data.zheng);
                    $("#zhian_yigai").html(data.yigai);
                    $("#zhian_daigai").html(data.daigai);
                    $("#zhian_daigaiyu").html(data.daigaiyu);
                }
            });
        }
        function get_lian_chart_piaokai_ban() {
            var enginidstr = $("#enginidstr").text();
            var year = $("#piaokai_year").val();
            facade.ajax({url: ask_lian_chart_piaokai_ban, data:{enginidstr:enginidstr,year:year}}).done(function(res){
                if (res.code === 2000) {
                    var data = res.data;
                    chart_piaokai('chart_piaokai', res.data.info);
                }
            });
        }
        function get_lian_chart_piaoshou_ban() {
            var enginidstr = $("#enginidstr").text();
            var year = $("#piaoshou_year").val();
            facade.ajax({url: ask_lian_chart_piaoshou_ban, data:{enginidstr:enginidstr,year:year}}).done(function(res){
                if (res.code === 2000) {
                    var data = res.data;
                    chart_piaoshou('chart_piaoshou', res.data.info);
                }
            });
        }
        function get_lian_chart_zongcheng_ban() {
            var enginidstr = $("#enginidstr").text();
            facade.ajax({url: ask_lian_chart_zongcheng_ban, data:{enginidstr:enginidstr}}).done(function(res){
                if (res.code === 2000) {
                    var data = res.data;
                    chart_zongcheng('chart_zongcheng', res.data.info);
                }
            });
        }
        function get_lian_chart_xiangshou_ban() {
            var enginidstr = $("#enginidstr").text();
            var year = $("#xiangshou_year").val();
            facade.ajax({url: ask_lian_chart_xiangshou_ban, data:{enginidstr:enginidstr,year:year}}).done(function(res){
                if (res.code === 2000) {
                    var data = res.data;
                    chart_xiangshou('chart_xiangshou', res.data.info);
                }
            });
        }
        function get_lian_chart_zhigong_ban() {
            var enginidstr = $("#enginidstr").text();
            var year = $("#zhigong_year").val();
            facade.ajax({url: ask_lian_chart_zhigong_ban, data:{enginidstr:enginidstr,year:year}}).done(function(res){
                if (res.code === 2000) {
                    var data = res.data;
                    chart_zhigong('chart_zhigong', res.data.info);
                }
            });
        }
        function get_lian_chart_zhilian_ban() {
            var enginidstr = $("#enginidstr").text();
            var year = $("#zhilian_year").val();
            facade.ajax({url: ask_lian_chart_zhilian_ban, data:{enginidstr:enginidstr,year:year}}).done(function(res){
                if (res.code === 2000) {
                    var data = res.data;
                    chart_zhilian('chart_zhilian', res.data.info);
                }
            });
        }
        function get_lian_chart_baojin_ban() {
            var enginidstr = $("#enginidstr").text();
            facade.ajax({url: ask_lian_chart_baojin_ban, data:{enginidstr:enginidstr}}).done(function(res){
                if (res.code === 2000) {
                    var data = res.data;
                    chart_baojin('chart_baojin', res.data.info);
                }
            });
        }
        function get_lian_zaxiang_ban() {
            var enginidstr = $("#enginidstr").text();
            facade.ajax({url: ask_lian_zaxiang_ban, data:{enginidstr:enginidstr,}}).done(function(res){
                if (res.code === 2000) {
                    var data = res.data;
                    $("#za_piaokaihe").html(parseFormatNum(data.za_piaokaihe));
                    $("#za_piaoshouhe").html(parseFormatNum(data.za_piaoshouhe));
                    $("#za_piao_xiao").html(parseFormatNum(data.za_piao_xiao));
                    $("#za_piao_jin").html(parseFormatNum(data.za_piao_jin));
                    $("#za_piao_ying").html(parseFormatNum(data.za_piao_ying));
                    $("#za_zongcheng").html(parseFormatNum(data.za_zongcheng));
                    $("#za_huikuan").html(parseFormatNum(data.za_huikuan));
                    $("#za_payment_engin").html(parseFormatNum(data.za_payment_engin));
                    $("#za_payment_neifu").html(parseFormatNum(data.za_payment_neifu));
                    $("#za_payment_neikou").html(parseFormatNum(data.za_payment_neikou));
                    $("#za_dian").html(parseFormatNum(data.za_dian));
                    $("#za_balance").html(parseFormatNum(data.za_balance));
                }
            });
        }
    });













    function chart_koushou(chat_id, data) {
        var info = []
        for (var key in data){
            info.push({ value: data[key] || 0, name: key });
        }



        var mychat = echarts.init(document.getElementById(chat_id), 'dark');
        mychat.clear();
        option = {
            // legend: {
            //     type: 'scroll',
            //     orient: 'vertical',
            //     right: 20,
            //     top: 50
            // },
            tooltip: {
                trigger: 'item',
                formatter: '{a} <br/>{b} : {c} ({d}%)'
            },
            series: [
                {
                    name: '单位（元）',
                    type: 'pie',
                    radius: '50%',
                    data: info
                }
            ]
        };
        mychat.setOption(option);
    }
    function chart_piaokai(chat_id, data) {
        var mychat = echarts.init(document.getElementById(chat_id), 'dark');
        mychat.clear();
        option = {
            color: '#5470c6',
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross'
                },
            },
            grid: {
                top: '15%',
                left: '20%',
                right: '10%',
                bottom: '30%'
            },
            xAxis: {
                type: 'category',
                data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
            },
            yAxis: {
                type: 'value',
                axisLabel: {
                    formatter: '{value} 元'
                }
            },
            series: [
                {
                    itemStyle:{
                        normal:{
                            label : {
                                show: true // 在折线拐点上显示数据
                            },
                            lineStyle:{
                                width:1,  // 设置虚线宽度
                            }
                        }
                    },
                    areaStyle: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                            {
                                offset: 0,
                                color: '#FFFFFF'
                            },
                            {
                                offset: 1,
                                color: '#5470c6'
                            }
                        ])
                    },
                    data: data,
                    type: 'line'
                }
            ]
        };
        mychat.setOption(option);
    }
    function chart_piaoshou(chat_id, data) {
        var mychat = echarts.init(document.getElementById(chat_id), 'dark');
        mychat.clear();
        option = {
            color: '#5470c6',
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross'
                },
            },
            grid: {
                top: '15%',
                left: '20%',
                right: '10%',
                bottom: '30%'
            },
            xAxis: {
                type: 'category',
                data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
            },
            yAxis: {
                type: 'value',
                axisLabel: {
                    formatter: '{value} 元'
                }
            },
            series: [
                {
                    itemStyle:{
                        normal:{
                            label : {
                                show: true // 在折线拐点上显示数据
                            },
                            lineStyle:{
                                width:1,  // 设置虚线宽度
                            }
                        }
                    },
                    areaStyle: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                            {
                                offset: 0,
                                color: '#FFFFFF'
                            },
                            {
                                offset: 1,
                                color: '#5470c6'
                            }
                        ])
                    },
                    data: data,
                    type: 'line'
                }
            ]
        };
        mychat.setOption(option);
    }
    function chart_zongcheng(chat_id, data) {
        var info = [
            { value: data.cai_fuku || 0, name: '材料费' },
            { value: data.ren_fuku || 0, name: '人工费' },
            { value: data.zu_fuku || 0, name: '租赁费' },
            { value: data.fen_fuku || 0, name: '分包费' },
            { value: data.cuo_fuku || 0, name: '措施费' }
        ]
        var mychat = echarts.init(document.getElementById(chat_id), 'dark');
        mychat.clear();
        option = {
            legend: {
                type: 'scroll',
                orient: 'vertical',
                right: 80,
                top: 50
            },
            tooltip: {
                trigger: 'item',
                formatter: '{a} <br/>{b} : {c} ({d}%)'
            },
            series: [
                {
                    name: '单位（元）',
                    type: 'pie',
                    radius: '50%',
                    center: ['40%', '50%'],
                    data: info
                }
            ]
        };
        mychat.setOption(option);
    }
    function chart_xiangshou(chat_id, data) {
        var mychat = echarts.init(document.getElementById(chat_id), 'dark');
        mychat.clear();
        option = {
            color: '#5470c6',
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross'
                },
            },
            grid: {
                top: '15%',
                left: '20%',
                right: '10%',
                bottom: '30%'
            },
            xAxis: {
                type: 'category',
                data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
            },
            yAxis: {
                type: 'value',
                axisLabel: {
                    formatter: '{value} 元'
                }
            },
            series: [
                {
                    itemStyle:{
                        normal:{
                            label : {
                                show: true // 在折线拐点上显示数据
                            },
                            lineStyle:{
                                width:1,  // 设置虚线宽度
                            }
                        }
                    },
                    areaStyle: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                            {
                                offset: 0,
                                color: '#FFFFFF'
                            },
                            {
                                offset: 1,
                                color: '#5470c6'
                            }
                        ])
                    },
                    data: data,
                    type: 'line'
                }
            ]
        };
        mychat.setOption(option);
    }
    function chart_zhigong(chat_id, data) {
        var mychat = echarts.init(document.getElementById(chat_id), 'dark');
        mychat.clear();
        option = {
            color: '#5470c6',
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross'
                },
            },
            grid: {
                top: '15%',
                left: '20%',
                right: '10%',
                bottom: '30%'
            },
            xAxis: {
                type: 'category',
                data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
            },
            yAxis: {
                type: 'value',
                axisLabel: {
                    formatter: '{value} 元'
                }
            },
            series: [
                {
                    itemStyle:{
                        normal:{
                            label : {
                                show: true // 在折线拐点上显示数据
                            },
                            lineStyle:{
                                width:1,  // 设置虚线宽度
                            }
                        }
                    },
                    areaStyle: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                            {
                                offset: 0,
                                color: '#FFFFFF'
                            },
                            {
                                offset: 1,
                                color: '#5470c6'
                            }
                        ])
                    },
                    data: data,
                    type: 'line'
                }
            ]
        };
        mychat.setOption(option);
    }
    function chart_zhilian(chat_id, data) {
        var mychat = echarts.init(document.getElementById(chat_id), 'dark');
        mychat.clear();
        option = {
            color: '#5470c6',
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross'
                },
            },
            grid: {
                top: '15%',
                left: '20%',
                right: '10%',
                bottom: '30%'
            },
            xAxis: {
                type: 'category',
                data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
            },
            yAxis: {
                type: 'value',
                axisLabel: {
                    formatter: '{value} 元'
                }
            },
            series: [
                {
                    itemStyle:{
                        normal:{
                            label : {
                                show: true // 在折线拐点上显示数据
                            },
                            lineStyle:{
                                width:1,  // 设置虚线宽度
                            }
                        }
                    },
                    areaStyle: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                            {
                                offset: 0,
                                color: '#FFFFFF'
                            },
                            {
                                offset: 1,
                                color: '#5470c6'
                            }
                        ])
                    },
                    data: data,
                    type: 'line'
                }
            ]
        };
        mychat.setOption(option);
    }
    function chart_baojin(chat_id, data) {
        var info = [
            { value: data.shou || 0, name: '累计收取' },
            { value: data.fan || 0, name: '累计返还' },
            { value: data.jiao || 0, name: '累计缴纳' },
            { value: data.tui || 0, name: '累计退回' },
        ]
        var mychat = echarts.init(document.getElementById(chat_id), 'dark');
        mychat.clear();
        option = {
            legend: {
                type: 'scroll',
                orient: 'vertical',
                left: 50,
                top: 80
            },
            tooltip: {
                trigger: 'item',
                formatter: '{a} <br/>{b} : {c} ({d}%)'
            },
            series: [
                {
                    name: '单位（元）',
                    type: 'pie',
                    radius: '50%',
                    center: ['60%', '50%'],
                    data: info
                }
            ]
        };
        mychat.setOption(option);
    }










    $("#but_ban_zi").click(function () {
        openNavPage('自营项目看板','ban_zi/index.php', 'ban_zi111')
    });
    $("#but_ban_lian").click(function () {
        window.location.reload();
    });
    $("#but_ban_cai").click(function () {
        openNavPage('财务看板','ban_cai/index.php', 'ban_cai111')
    });
</script>
</body>
</html>
